// 环境配置管理
export const ENV_CONFIG = {
    // 当前环境
    NODE_ENV: import.meta.env.MODE || 'development',
    
    // API配置
    API: {
        // 开发环境 - 本地服务器
        development: {
            baseURL:'http://123.60.213.46:8000',
            timeout: 10000,
            doctorList: '/doctor/list',
            search: '/search',
            searchDepartment: '/search/department'
        },
        
        // 生产环境 - 妙手医生API
        production: {
            baseURL: 'http://123.60.213.46:8000',
            timeout: 15000,
            doctorList: '/doctor/list',
            search: '/search',
            searchDepartment: '/search/department'
        },
        
        // 测试环境
        test: {
            baseURL: 'http://123.60.213.46:8000',
            timeout: 10000,
            doctorList: '/doctor/list',
            search: '/search',
            searchDepartment: '/search/department'
        }
    }
}

// 获取当前环境的API配置
export const getCurrentApiConfig = () => {
    const env = ENV_CONFIG.NODE_ENV
    return ENV_CONFIG.API[env as keyof typeof ENV_CONFIG.API] || ENV_CONFIG.API.development
}

// 获取API基础URL
export const getApiBaseUrl = () => {
    return getCurrentApiConfig().baseURL
}

// 获取医生列表API路径
export const getDoctorListPath = () => {
    return getCurrentApiConfig().doctorList
}

// 检查是否为生产环境
export const isProduction = () => {
    return ENV_CONFIG.NODE_ENV === 'production'
}

// 检查是否为开发环境
export const isDevelopment = () => {
    return ENV_CONFIG.NODE_ENV === 'development'
}

export default ENV_CONFIG
